<script src="components/com_pgb/public/uploadlib/jquery.min.js" type="text/javascript"></script>
<script src="components/com_pgb/public/uploadlib/jquery.uploadify.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="components/com_frmessage/public/uploadlib/uploadify.css"/>

<script type="text/javascript" src="../media/system/js/jQuery.vietvang.validate.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$('#adminForm').validate({
			});
		});
</script>

<?php 
   $options = array(
       'onActive' => 'function(title, description){
           description.setStyle("display", "block");
           title.addClass("open").removeClass("closed");
       }',
       'onBackground' => 'function(title, description){
           description.setStyle("display", "none");
           title.addClass("closed").removeClass("open");
       }',
       'startOffset' => 0,  // 0 starts on the first tab, 1 starts the second, etc...
       'useCookie' => true, // this must not be a string. Don't use quotes.
   );
?>
    <form action="index.php?option=com_pgb" method="post" name="adminForm" id="adminForm" class="adminform" enctype="multipart/form-data">

<table id="table_club_1" border=0>
    <tr>
      <td></td>
      <td class="err">※印は入力必須項目です。</td>
   </tr>
   <tr>
      <td style="width: 160px;">センター・クラブコード<span class="err">※</span></td>
      <td style="width: 180px;">
        <input data_required="true" vvName="number" type="text" id="jformOCBA_CODE" name="jform[OCBA_CODE]"  style="float: left;" class = "inputbox small" value="<?php echo $this->ocba_code; ?>" onchange = "centerName(this.value);checkCenter(this.value);" /><a href="#" id="link_ocba_code" style="float: left;" >検索</a>
        <input type="hidden" name="ocba_code_old" id="ocba_code_old" value="<?php echo $this->ocba_code; ?>" />
        <input type="hidden" name="addnew" id="addnew" value="<?php echo $this->addnew; ?>" />
        <span name="msg_error"></span>  
      </td>
      <td colspan="2"><input type="text" id="jformOCBA_NAME" class="inputbox big" value="<?php echo $this->ocba_name; ?>" disabled="true"/> </td>
   </tr>
       <td></td>
        <td colspan="3" id="resultCheck"></td>
   </tr>
</table>

  
<?php echo JHtml::_('tabs.start', 'tab_group_id', $options);?>
<?php echo JHtml::_('tabs.panel', JText::_('プール'), 'panel_1_id');?>

<div id="panel_1">

<table id="table_club_1" border=0>
  <tr style="visibility:hidden">
    <td style="width: 160px"></td>
    <td style="width: 220px"></td>
    <td style="width: 160px"></td>
    <td style="width: 220px"></td>
    <td style="width: 458px"></td>
  </tr>
   <tr>
      <td colspan="5"><img src="templates/toppage-BG/images/square.jpg"  style="width: 8px; height: 8px;" /> プール</td>
   </tr>
   <tr <?php if(!isset($this->item_pool->POOL_CODE)) echo "style='visibility: hidden'";?>>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">プールコード<span class='err'></span></td>
        <td colspan="3">
        <?php if(isset($this->item_pool->POOL_CODE)){ ?> 
            <label style="margin-top:0px"><?php echo $this->item_pool->POOL_CODE; ?></label>
            <input name="jform[POOL_CODE]" type="hidden" value="<?php echo $this->item_pool->POOL_CODE; ?>" />
        <?php }else{ ?>
            <label style="margin-top:0px"><?php echo HelperBG::getIDAuto('pool','POOL_CODE');?></label>
            
        <?php } ?>
        </td>
   </tr>
   <tr>
      <!-- <td style="text-align: right;font-size: 1.091em;padding-right:5px;">運営委託業者<span class='err'></span></td> -->
      <td style="text-align: right;font-size: 1.091em;padding-right:5px;">運営委託業者</td>
      <td colspan="4"> <input class="input medium" type="text" name="jform[POOL_ADMN]" value="<?php echo $this->item_pool->POOL_ADMN; ?>" /></td>
   </tr>
   <tr>
      <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">開設日</td>
      <td style="vertical-align:top">
        <?php if($this->item_pool->POOL_SDATE != 0){ $dt = date('Y-m-d',strtotime($this->item_pool->POOL_SDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[POOL_SDATE]', 'jformPOOL_SDATE');?>      
        <span name="msg_error"></span> 
      </td>
      <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">譲渡日</td>
      <td style="vertical-align:top">
        <?php if($this->item_pool->POOL_TDATE != 0){ $dt = date('Y-m-d',strtotime($this->item_pool->POOL_TDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[POOL_TDATE]', 'jformPOOL_TDATE');?>     
        <span name="msg_error"></span> 
      </td>
      <td></td>
   </tr>
   <tr style="vertical-align:top">
      <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">プール種別<span class='err'></span></td>
      <td>
        <select id="jform-pool-polk" name="jform[POOL_POLK]" class="medium">
          <option value="">選択してください</option>
        <?php foreach($this->poolType as $key=>$value){ ?>
        	<option value="<?php echo $key ?>" <?php if($key == $this->item_pool->POOL_POLK) echo "selected";?> ><?php echo $value ?></option>
        <?php } ?>
        </select>
      </td>
      <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">廃止日</td>
      <td>
        <?php if($this->item_pool->POOL_EDATE != 0){ $dt = date('Y-m-d',strtotime($this->item_pool->POOL_EDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[POOL_EDATE]', 'jformPOOL_EDATE');?>
        <span name="msg_error"></span> 
      </td>
      <td></td>
   </tr>
   <tr>
      <td style="text-align: right;font-size: 1.091em;padding-right:5px;">温水種別<span class='err'></span></td>
      <td colspan="4"> 
        <select id="jform-pool-pohk" name="jform[POOL_POHK]" class="medium">
          <option value="">選択してください</option>
        <?php foreach($this->poolHolk as $key=>$value){ ?>
        	<option value="<?php echo $key ?>" <?php if($key == $this->item_pool->POOL_POHK) echo "selected";?>><?php echo $value ?></option>
        <?php }?>
        </select>
      </td>
      
   </tr>
   <tr>
    <td style="text-align: right;font-size: 1.091em;padding-right:5px;">開館期間<span class='err'></span></td>
    <td colspan="4">
        <input type="text"  name="jform[POOL_TERM]" value="<?php echo $this->item_pool->POOL_TERM; ?>" style="width: 540px;" />
    </td>
   </tr>
    <tr>
        <td colspan="5">
            <fieldset id="adminformfieldset">
               <legend>設備</legend>
               <table id="table_device_list">
                  
                  <tr>
                     <td style="padding-top:10px;text-align: right;font-size: 1.091em;vertical-align: top;width:12%;">拡張施設</td>
                     <td colspan="4">
                         <table style="width: 100%;" border=0>                    
                        <?php
                                
                            $POOL_TBPO_CODE_LIST = $this->item_pool->POOL_TBPO_CODE_LIST;
                            if(isset($POOL_TBPO_CODE_LIST)){ $tbpo_list = explode(",",$POOL_TBPO_CODE_LIST); }
                            if($this->extendFac != null){
                                foreach($this->extendFac as $k=>$value){
                                    if($k%4 == 0){
                                        echo "<tr>";
                                    }
                                    if(empty($tbpo_list))
                                        $checked = "";
                                    else {
                                        $checked = array_search($value->TBPO_CODE, $tbpo_list) !== false ? "checked" : "";
                                    }                                        
                                    echo "<td style='width:1%'><input type='checkbox' style='float:right;' name='cbfac$value->TBPO_CODE' id='cbfac$value->TBPO_CODE' value='$value->TBPO_CODE' $checked/></td>";
                                    echo "<td><label for='cbfac$value->TBPO_CODE'>$value->TBPO_NAME</label></td>";                                            
                                    
                                    if($k%4 == 3){
                                        echo "</tr>";
                                    }
                                }
                            }
                         ?> 
                        </table>
                     </td>                                        
                  </tr>
                  <tr>
                    <td colspan="5"><br /></td>
                  </tr>
                  <tr>
                     <td style="padding-top:10px;text-align: right;font-size: 1.091em;padding-right:5px;vertical-align: top;line-height:30px">バリアフリー<span class='err'></span></td>
                     <td colspan="4" style="line-height: 30px;">                                             
                        <table style="width: 100%;" border=0>
                            <?php
                                
                                $POOL_DISP_CODE_LIST = $this->item_pool->POOL_DISP_CODE_LIST;
                                if(isset($POOL_DISP_CODE_LIST)){ $list_disp_pool = explode(",",$POOL_DISP_CODE_LIST); }
                                if($this->disabled != null){
                                    foreach($this->disabled as $k=>$value){
                                        if($k%4 == 0){
                                            echo "<tr>";
                                        }
                                        if(empty($list_disp_pool))
                                            $checked = "";
                                        else
                                            $checked = array_search($value->DISP_CODE, $list_disp_pool) !== false ? "checked" : "";
                                        echo "<td style='width:1%'><input type='checkbox' style='float:right;' name='cbdis$value->DISP_CODE' id='cbdis$value->DISP_CODE' value='$value->DISP_CODE' $checked/></td>";
                                        echo "<td><label for='cbdis$value->DISP_CODE'>$value->DISP_NAME</label></td>";                                            
                                        
                                        if($k%4 == 3){
                                            echo "</tr>";
                                        }
                                    }
                                }
                             ?>  
                        
                        </table>
                        
                     </td>
                  </tr>
                </table>
            </fieldset>
        </td>
    </tr>
	<tr>
		<td style="float:right !important;line-height: 28px;font-size: 1.091em;width:65px" class="rd">施設利用<span class='err'></span></td>
		<td colspan="5">
            <select id="jform-pool-metk" name="jform[POOL_METK]" class="medium">
              <option value="9">選択してください</option>
                <?php foreach($this->poolMetk as $key=>$value){ ?>
        	       <option value="<?php echo $key ?>" <?php if($key == $this->item_pool->POOL_METK && $this->item_pool->POOL_METK ) echo "selected";?> ><?php echo $value ?></option>
                <?php }?>
        </select>
        </td>
		
	</tr>
    <tr>
     <td colspan="5">
    <fieldset id="adminformfieldset">
   
       <legend>料金</legend>
       <table id="table_fee_list" border=0 style="width: 100%;">
          <tr style="visibility:hidden">
            <td style="width:145px"></td>
            <td style="width:220px"></td>
            <td style="width:167px"></td>
            <td style="width:220px"></td>
            <td style="width:435px"></td>
          </tr>
          <tr style="vertical-align:top">
             <td style=" text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px" >町内大人</td>
             <td >
                <input type="text" vvName="money"  id="jform-pool-ciad" name="jform[POOL_CIAD]" class="inputbox medium" value="<?php echo $this->item_pool->POOL_CIAD; ?>" />
                <span name="msg_error"></span>
             </td>
             <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">町内子供</td>
             <td>
                <input type="text" vvName="money" class="inputbox medium" id="jform-pool-cici" name="jform[POOL_CICI]" value="<?php echo $this->item_pool->POOL_CICI; ?>" />
                 <span name="msg_error"></span>
             </td>
          </tr>
          <tr style="vertical-align:top">
             <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">町外大人</td>
             <td>
                <input type="text" vvName="money" class="inputbox medium" id="jform-pool-coad" name="jform[POOL_COAD]" value="<?php echo $this->item_pool->POOL_COAD; ?>" />
                 <span name="msg_error"></span>
             </td>
             <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px" >町外子供</td>
             <td>
                <input type="text" vvName="money" class="inputbox medium" id="jform-pool-coci" name="jform[POOL_COCI]" value="<?php echo $this->item_pool->POOL_COCI; ?>" />
                <span name="msg_error"></span>
             </td>
          </tr>
          <td style="text-align: right;font-size: 1.091em;padding-right:5px;">備考</td>
          <td colspan="3"> <input type="text" id="jform-pool-cnot" name="jform[POOL_CNOT]" class="input xbig" value="<?php echo $this->item_pool->POOL_CNOT; ?>" /></td>
       </table>
    </fieldset>
    </td>
    </tr>
    <tr>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">備考</td>
        <td colspan="4"> <textarea  id="jform-pool-note" name="jform[POOL_NOTE]" style="width: 60.5%;"><?php echo $this->item_pool->POOL_NOTE; ?></textarea></td>
    </tr>   

</table> 
</div>

   <?php echo JHtml::_('tabs.panel', JText::_('体育館'), 'panel_2_id');?>
<div id="panel_2">
    <table id="gymnasium_list1" style="width:100%;" border=0>
      <tr style="visibility:hidden">
        <td style="width: 160px"></td>
        <td style="width: 220px"></td>
        <td style="width: 160px"></td>
        <td style="width: 220px"></td>
        <td style="width: 460px"></td>
      </tr>
    <tr>
        <td colspan="5">
            <span class='err' style="line-height:30px;font-size: 1.091em !important;font-size:12px"></span>
            <select id="jform-gymt_2ndk" name="jform[GYMT_2NDK]">
            <?php foreach($this->gym as $key=>$value){ ?>
    	       <option value="<?php echo $key ?>" <?php if($key == 2 && (count($this->list_gymt) == 2 || $this->list_gymt[1]->GYMT_2NDK == 2)) echo "selected";?> ><?php echo $value ?></option>
            <?php } ?>
            </select>
        </td>
    </tr>
    <tr>
        <td colspan="5"><img src="templates/toppage-BG/images/square.jpg" style="text-align: right;font-size: 1.091em;padding-right:5px;" />第一体育館</td>
    </tr>
    <tr <?php if(!isset($this->list_gymt[0]->GYMT_CODE)) echo "style='visibility: hidden'"?>>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">第一体育館コード<span class='err'></span></td>
        <td colspan="4">
        <?php if(isset($this->list_gymt[0]->GYMT_CODE)){ ?>
            <label style="margin-top:0px" id="gym-code1"><?php echo $this->list_gymt[0]->GYMT_CODE; ?></label>
            <input id="jform-gymt-code1" name="jform[GYMT_CODE1]" type="hidden" value="<?php echo $this->list_gymt[0]->GYMT_CODE; ?>" />
        <?php }else{ ?>
            <label style="margin-top:0px" id="gym-code1"><?php echo HelperBG::getIDAuto('gymt','GYMT_CODE');?></label>
            
        <?php } ?>
        </td>  
    </tr>
    <tr>
        <!-- <td style="text-align: right;font-size: 1.091em;padding-right:5px;">運営委託業者<span class='err'></span></td> -->
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">運営委託業者</td>
        <td colspan="4"> <input type="text" id="jform-gymt-admn1" name="jform[GYMT_ADMN1]" class="input medium" value="<?php echo $this->list_gymt[0]->GYMT_ADMN; ?>" /></td>
       
    </tr>
    <tr>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">開設日</td>
        <td style="">
            <?php if($this->list_gymt[0]->GYMT_SDATE != 0){ $dt = date('Y-m-d',strtotime($this->list_gymt[0]->GYMT_SDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[GYMT_SDATE1]', 'jformGYMT_SDATE1');?>
            <span name="msg_error"></span>
        </td>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">譲渡日</td>
        <td style="vertical-align:top">
            <?php if($this->list_gymt[0]->GYMT_TDATE != 0){ $dt = date('Y-m-d',strtotime($this->list_gymt[0]->GYMT_TDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[GYMT_TDATE1]', 'jformGYMT_TDATE1');?>
            <span name="msg_error"></span>
        </td>
        <td></td>
    </tr>
    
    <tr style="vertical-align: top;">
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">ミーティングルーム種別<span class='err'></span></td>
        <td >
            <select id="jform-gymt-metk1" name="jform[GYMT_METK1]" class="medium">
              <option value="">選択してください</option>
                <?php foreach($this->gymtMetk as $key=>$value){ ?>
        	       <option value="<?php echo $key ?>" <?php if($key == $this->list_gymt[0]->GYMT_METK) echo "selected";?> ><?php echo $value ?></option>
                <?php }?>
            </select>
        </td>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">廃止日</td>
        <td>
            <?php if($this->list_gymt[0]->GYMT_EDATE != 0){ $dt = date('Y-m-d',strtotime($this->list_gymt[0]->GYMT_EDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[GYMT_EDATE1]', 'jformGYMT_EDATE1');?>
            <span name="msg_error"></span>
        </td>
        <td></td>
    </tr>
    <tr>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">バリアフリー<span class='err'></span></td>
        <td colspan="4">
            
            <table style="width: 50%;">
                <?php
                    
                    $GYMT_TBGY_CODE_LIST = $this->list_gymt[0]->GYMT_TBGY_CODE_LIST;
                    if(isset($GYMT_TBGY_CODE_LIST)){ $list_disabled_gymt = explode(",",$GYMT_TBGY_CODE_LIST); }
                    
                    if($this->listDisabledGymt != null){
                        foreach($this->listDisabledGymt as $k=>$value){
                            if($k%4 == 0){
                                echo "<tr>";
                            }
                            if(empty($list_disabled_gymt))
                                $checked = "";
                            else
                                $checked = array_search($value->TBGY_CODE, $list_disabled_gymt) !== false ? "checked" : "";
                            echo "<td><input type='checkbox' style='float:right;' name='cbdisgym$value->TBGY_CODE' id='cbdisgym$value->TBGY_CODE' value='$value->TBGY_CODE' $checked/></td>";
                            echo "<td><label for='cbdisgym$value->TBGY_CODE'>$value->TBGY_NAME</label></td>";                                            
                            
                            if($k%4 == 3){
                                echo "</tr>";
                            }
                        }
                    }
                 ?>  
            
            </table>
        </td>
    </tr>
    <tr>
        <td colspan="5">
            <fieldset id="adminformfieldset">
                <legend>料金</legend>
               <table id="table_fee_list" border=0 style="width: 100%;">
                <tr style="visibility:hidden">
                  <td style="width: 150px"></td>
                  <td style="width: 220px"></td>
                  <td style="width: 160px"></td>
                  <td style="width: 220px"></td>
                  <td style="width: 460px"></td>
                </tr>
                    <tr style="vertical-align:top">
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px" >町内大人</td>
                        <td >
                            <input type="text" vvName="money" id="jform-gymt-ciad1" name="jform[GYMT_CIAD1]" class="inputbox medium" value="<?php echo $this->list_gymt[0]->GYMT_CIAD; ?>" />
                            <span name="msg_error"></span>
                        </td>
                        <td style=" text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">町内子供</td>
                        <td>
                            <input type="text" vvName="money" id="jform-gymt-cici1" name="jform[GYMT_CICI1]" class="inputbox medium" value="<?php echo $this->list_gymt[0]->GYMT_CICI; ?>" />
                            <span name="msg_error"></span>
                        </td>
                    </tr>
                    <tr style="vertical-align:top">
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">町外大人</td>
                        <td>
                            <input type="text" vvName="money" id="jform-gymt-coad1" name="jform[GYMT_COAD1]" class="inputbox medium" value="<?php echo $this->list_gymt[0]->GYMT_COAD; ?>" />
                            <span name="msg_error"></span>
                        </td>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">町外子供</td>
                        <td>
                            <input type="text" vvName="money" id="jform-gymt-coci1" name="jform[GYMT_COCI1]" class="inputbox medium" value="<?php echo $this->list_gymt[0]->GYMT_COCI; ?>" />
                            <span name="msg_error"></span>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">備考</td>
                        <td colspan="3"> <input type="text" id="jform-gymt-cnot1" name="jform[GYMT_CNOT1]" class="input xbig" value="<?php echo $this->list_gymt[0]->GYMT_CNOT; ?>" /></td>
                    </tr>
               </table>
            </fieldset>
        </td>
    </tr>
    <tr>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">備考</td>
        <td colspan="4"> <textarea  id="jform-gymt-note1" name="jform[GYMT_NOTE1]" style="width: 57.5%;"><?php echo $this->list_gymt[0]->GYMT_NOTE; ?></textarea></td>
    </tr>
  </table>
  <br><br>
  <!-- wrapper gym2 -->
  <div id="wrapper-gym2" style="display: none;">
  <table id="gymnasium_list2" style="width:100%;" border=0>
    <tr style="visibility:hidden">
        <td style="width: 160px"></td>
        <td style="width: 220px"></td>
        <td style="width: 160px"></td>
        <td style="width: 220px"></td>
        <td style="width: 460px"></td>
      </tr>
    <tr>
        <td colspan="5"><img src="templates/toppage-BG/images/square.jpg"  style="width: 8px; height: 8px;" />第二体育館</td>
    </tr>
     <tr <?php if(!isset($this->list_gymt[1]->GYMT_CODE)) echo "style='visibility: hidden'"?>>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">第二体育館コード<span class='err'></span></td>
        <td colspan="3">
        <?php if(isset($this->list_gymt[1]->GYMT_CODE)){ ?>
            <label  id="gym-code2"><?php  echo $this->list_gymt[1]->GYMT_CODE; ?></label>
            <input id="jform[GYMT_CODE2]" name="jform[GYMT_CODE2]" type="hidden" value="<?php echo $this->list_gymt[1]->GYMT_CODE; ?>" />
        <?php }else{ ?>
            <label  id="gym-code2"><?php  $ID= HelperBG::getIDAuto('gymt','GYMT_CODE')+1; echo $ID; ?></label>
            
        <?php } ?>
        </td>  
    </tr>
    <tr>
        <!-- <td style="text-align: right;font-size: 1.091em;padding-right:5px;">運営委託業者<span class='err'></span></td> -->
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">運営委託業者</td>
        <td colspan="4"> <input class="input medium" type="text" id="jform-gymt-admn2" name="jform[GYMT_ADMN2]"  value="<?php echo $this->list_gymt[1]->GYMT_ADMN; ?>" /></td>
        
    </tr>
    <tr style="vertical-align:top">
        <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">開設日</td>
        <td style="">
            <?php if($this->list_gymt[1]->GYMT_SDATE != 0){ $dt = date('Y-m-d',strtotime($this->list_gymt[1]->GYMT_SDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[GYMT_SDATE2]', 'jformGYMT_SDATE2');?>
            <span name="msg_error"></span>
        </td>
        <td style="line-height: 30px; vertical-align: top;font-size: 1.091em;" class="text-align">譲渡日</td>
        <td>
            <?php if($this->list_gymt[1]->GYMT_TDATE != 0){ $dt = date('Y-m-d',strtotime($this->list_gymt[1]->GYMT_TDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[GYMT_TDATE2]', 'jformGYMT_TDATE2');?>
            <span name="msg_error"></span>
        </td>
        <td></td>
    </tr>
    <tr style="vertical-align:top">
        <td></td>
        <td></td>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">廃止日</td>
        <td>
            <?php if($this->list_gymt[1]->GYMT_EDATE != 0){ $dt = date('Y-m-d',strtotime($this->list_gymt[1]->GYMT_EDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[GYMT_EDATE2]', 'jformGYMT_EDATE2');?>
            <span name="msg_error"></span>
        </td>
        <td></td>
    </tr>
    <tr>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">設備<span class='err'></span></td>
        <td colspan="4">
        
            <table style="width: 30%;">
                <tr>
            <?php
                
                foreach($this->equipment as $key=>$value){?>
                <td><input type="checkbox" name="cbeq<?php echo $key; ?>" id="cbeq<?php echo $key; ?>" value="<?php echo $value; ?>"  <?php if(($key == 1 && $this->list_gymt[1]->GYMT_MATF == 1) || ($key == 2 && $this->list_gymt[1]->GYMT_MACF == 1)) { echo 'checked="checked"'; } ?>  /></td>
                <td><label for="cbeq<?php echo $key; ?>"><?php echo $value; ?></label></td>
            <?php }?>
            
            </tr>
            </table>
            
        </td>
    </tr>
    <tr>
        <td colspan="5">
            <fieldset id="adminformfieldset">
                <legend>料金</legend>
               <table id="table_fee_list" border=0 style="width: 100%">
                    <tr style="visibility:hidden">
                      <td style="width: 150px"></td>
                      <td style="width: 220px"></td>
                      <td style="width: 160px"></td>
                      <td style="width: 220px"></td>
                      <td style="width: 460px"></td>
                    </tr>
                    <tr style="vertical-align:top">
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px" >町内大人</td>
                        <td>
                            <input type="text" vvName="money" id="jform-gymt-ciad2" name="jform[GYMT_CIAD2]" class="inputbox medium" value="<?php echo $this->list_gymt[1]->GYMT_CIAD; ?>" />
                            <span name="msg_error"></span> 
                        </td>
                        <td style="line-height:30px;font-size: 1.091em;" class="text-align">町内子供</td>
                        <td>
                            <input type="text" vvName="money" id="jform-gymt-cici2" name="jform[GYMT_CICI2]" class="inputbox medium" value="<?php echo $this->list_gymt[1]->GYMT_CICI; ?>" />
                            <span name="msg_error"></span>
                        </td>
                    </tr>
                    <tr style="vertical-align:top">
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">町外大人</td>
                        <td>
                            <input type="text" vvName="money" id="jform-gymt-coad2" name="jform[GYMT_COAD2]" class="inputbox medium" value="<?php echo $this->list_gymt[1]->GYMT_COAD; ?>" />
                            <span name="msg_error"></span>
                        </td>
                        <td class="text-align" style="line-height:30px;font-size: 1.091em;">町外子供</td>
                        <td>
                            <input type="text" vvName="money" id="jform-gymt-coci2" name="jform[GYMT_COCI2]" class="inputbox medium" value="<?php echo $this->list_gymt[1]->GYMT_COCI; ?>" />
                            <span name="msg_error"></span>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">備考</td>
                        <td colspan="3"> <input type="text" id="jform-gymt-cnot2" name="jform[GYMT_CNOT2]" class="input xbig" value="<?php echo $this->list_gymt[1]->GYMT_CNOT; ?>" /></td>
                    </tr>
               </table>
            </fieldset>
        </td>
    </tr>
    <tr>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">備考</td>
        <td colspan="4"> <textarea id="jform-gymt-note2" name="jform[GYMT_NOTE2]" style="width: 57.5%;"><?php echo $this->list_gymt[1]->GYMT_NOTE; ?></textarea></td>
    </tr>
  </table>
  </div><!-- end wrapper gym2 -->
</div>
   <?php echo JHtml::_('tabs.panel', JText::_('艇庫'), 'panel_3_id');?>
<div id="panel_3">
   <table id="boathouse_list" border=0>
    <tr style="visibility:hidden">
        <td style="width: 160px"></td>
        <td style="width: 220px"></td>
        <td style="width: 160px"></td>
        <td style="width: 220px"></td>
        <td style="width: 440px"></td>
      </tr>
    <tr>
        <td colspan="5"><img src="templates/toppage-BG/images/square.jpg" style="width: 8px; height: 8px;" />艇庫</td>
        
    </tr>
     <tr <?php if(!isset($this->item_dock->DOCK_CODE)) echo "style='visibility: hidden'"?>>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">艇庫コード<span class='err'></span></td>
        <td colspan="4">
        <?php if(isset($this->item_dock->DOCK_CODE)){ ?>
             <label style="margin-top:0px" id="dock-code"><?php echo $this->item_dock->DOCK_CODE; ?></label>
            <input id="jformDOCK_CODE" name="jform[DOCK_CODE]" type="hidden" value="<?php echo $this->item_dock->DOCK_CODE; ?>" />
        <?php }else{ ?>
            <label  style="margin-top:0px" id="dock-code"><?php echo HelperBG::getIDAuto('dock','DOCK_CODE');?></label>
            
        <?php } ?>
        </td>  
    </tr>
    <tr>
        <!-- <td style="text-align: right;font-size: 1.091em;padding-right:5px;">運営委託業者<span class='err'></span></td> -->
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">運営委託業者</td>
        <td colspan="4"><input type="text" id="jform-dock-admn" name="jform[DOCK_ADMN]" class="input medium" value="<?php echo $this->item_dock->DOCK_ADMN; ?>" /></td>  
    </tr>
    <tr style="vertical-align:top">
         <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">開設日</td>
         <td style="" >
            <?php if($this->item_dock->DOCK_SDATE != 0){ $dt = date('Y-m-d',strtotime($this->item_dock->DOCK_SDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[DOCK_SDATE]', 'jformDOCK_SDATE');?>
            <span name="msg_error"></span>
         </td>
         <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">譲渡日</td>
         <td>
            <?php if($this->item_dock->DOCK_TDATE != 0){ $dt = date('Y-m-d',strtotime($this->item_dock->DOCK_TDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[DOCK_TDATE]', 'jformDOCK_TDATE');?>
            <span name="msg_error"></span>
         </td>
         <td></td>
    </tr>
    <tr style="vertical-align:top">
         <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">郵便番号</td>
         <td style="" >
            <input type="text" vvName="postcode" id="jform-dock-post" name="jform[DOCK_POST]" class="inputbox medium" value="<?php echo $this->item_dock->DOCK_POST; ?>" />
            <span name="msg_error"></span>
         </td>
         <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">廃止日</td>
         <td>
            <?php if($this->item_dock->DOCK_EDATE != 0){ $dt = date('Y-m-d',strtotime($this->item_dock->DOCK_EDATE));}else{ $dt=null;} echo JHtml::calendar($dt, 'jform[DOCK_EDATE]', 'jformDOCK_EDATE');?>
            <span name="msg_error"></span>
         </td>
         <td></td>
    </tr>
    <tr>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">住所</td>
        <td colspan="4"><input type="text" id="jform-dock-add1" name="jform[DOCK_ADD1]" class="input medium" value="<?php echo $this->item_dock->DOCK_ADD1; ?>" /></td>  
    </tr>
    <tr style="vertical-align:top">
         <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">TEL</td>
         <td style="" >
            <input type="text" vvName="phone" id="jform-dock-tel" name="jform[DOCK_TEL]" class="inputbox medium" value="<?php echo $this->item_dock->DOCK_TEL; ?>" />
            <span name="msg_error"></span>
         </td>
         <td style="text-align: right;font-size: 1.091em;padding-right:5px; line-height: 30px; vertical-align: top;">FAX</td>
         <td>
            <input type="text" vvName="fax" id="jform-dock-fax" name="jform[DOCK_FAX]" class="inputbox medium" value="<?php echo $this->item_dock->DOCK_FAX; ?>" />
            <span name="msg_error"></span>
         </td>
         <td></td>
    </tr>
    <tr>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">開館期間</td>
        <td colspan="4">
            <input type="text" id="jform-dock-term" name="jform[DOCK_TERM]" style="width:540px" value="<?php echo $this->item_dock->DOCK_TERM; ?>" />
        </td>  
    </tr>
    <tr>
         <td style="text-align: right;font-size: 1.091em;padding-right:5px;">艇庫種別<span class='err'></span></td>
         <td>
            <select id="jform-dock-docm-code" name="jform[DOCK_DOCM_CODE]" class="medium">
              <option value="">選択してください</option>
                <?php foreach($this->boatType as $value){ ?>
        	       <option value="<?php echo $value->DOCM_CODE ?>" <?php if($this->item_dock->DOCK_DOCM_CODE == $value->DOCM_CODE){ echo 'selected="selected"'; } ?> ><?php echo $value->DOCM_NAME?></option>
                <?php }?>  
            </select>
         </td>
         <td style="text-align: right;font-size: 1.091em;padding-right:5px;">常勤者<span class='err'></span></td>
         <td>
            <select id="jform-dock-ftmf" name="jform[DOCK_FTMF]" class="medium">
              <option value="9">選択してください</option>
                <?php foreach($this->employee as $key=>$value){ ?>
    	           <option value="<?php echo $key ?>"<?php if($key == $this->item_dock->DOCK_FTMF && $this->item_dock->DOCK_FTMF !== null) echo "selected" ?> ><?php echo $value?></option>
                <?php }?>  
            </select>
         </td>
         <td></td>
    </tr>
    <tr>
         <td style="text-align: right;font-size: 1.091em;padding-right:5px;">利用予約<span class='err'></span></td>
         <td>
                <select  id="jform-dock-dowm-code" name="jform[DOCK_RSVF]" class="medium">
                  <option value="9">選択してください</option>
                    <?php foreach($this->listDock_rsvf as $key=>$value){ ?>
    	               <option value="<?php echo $key ?>" <?php if($key == $this->item_dock->DOCK_RSVF && $this->item_dock->DOCK_RSVF !== null){ echo 'selected="selected"'; } ?> ><?php echo $value ?></option>
                    <?php }?> 
                </select>
         </td>
         <td colspan="3"></td>
    </tr>
    <tr>
        <td colspan="5">
         <fieldset id="adminformfieldset">
                <legend>設備</legend>
               <table id="table_fee_list" border=0>
                    <tr style="visibility:hidden">
                      <td style="width: 150px"></td>
                      <td style="width: 220px"></td>
                      <td style="width: 160px"></td>
                      <td style="width: 220px"></td>
                      <td style="width: 460px"></td>
                    </tr>
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">トイレ種別<span class='err'></span></td>
                        <td >
                           <select id="jform-dock-toyk" name="jform[DOCK_TOYK]" class="medium">
                            <option value="9">選択してください</option>
                                <?php foreach($this->listDock as $key=>$value){ ?>
    	                           <option value="<?php echo $key ?>"<?php if($key == $this->item_dock->DOCK_TOYK && $this->item_dock->DOCK_TOYK !== null) echo "selected" ?> ><?php echo $value?></option>
                                <?php }?>  
                            </select>
                        </td>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">シャワー種別<span class='err'></span></td>
                        <td >
                            <select id="jform-dock-shwk" name="jform[DOCK_SHWK]" class="medium">
                              <option value="9">選択してください</option>
                                <?php foreach($this->listDock as $key=>$value){ ?>
    	                           <option value="<?php echo $key ?>"<?php if($key == $this->item_dock->DOCK_SHWK && $this->item_dock->DOCK_SHWK !== null) echo "selected" ?> ><?php echo $value?></option>
                                <?php }?>  
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">温水シャワー種別<span class='err'></span></td>
                        <td>
                            <select id="jform-dock-shhk" name="jform[DOCK_SHHK]" class="medium">
                              <option value="9">選択してください</option>
                                <?php foreach($this->listDock as $key=>$value){ ?>
    	                           <option value="<?php echo $key ?>"<?php if($key == $this->item_dock->DOCK_SHHK && $this->item_dock->DOCK_SHHK !== null) echo "selected" ?> ><?php echo $value?></option>
                                <?php }?>  
                            </select>
                        </td>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">更衣室種別<span class='err'></span></td>
                        <td>
                            <select id="jform-dock-chak" name="jform[DOCK_CHAK]" class="medium">
                              <option value="9">選択してください</option>
                                <?php foreach($this->listDock as $key=>$value){ ?>
    	                           <option value="<?php echo $key ?>"<?php if($key == $this->item_dock->DOCK_CHAK && $this->item_dock->DOCK_CHAK !== null) echo "selected" ?> ><?php echo $value?></option>
                                <?php }?>  
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">駐車スペース種別<span class='err'></span></td>
                        <td colspan="3">
                            <select id="jform-dock-pakk" name="jform[DOCK_PAKK]" class="medium">
                              <option value="9">選択してください</option>
                                <?php foreach($this->listDock as $key=>$value){ ?>
    	                           <option value="<?php echo $key ?>"<?php if($key == $this->item_dock->DOCK_PAKK && $this->item_dock->DOCK_PAKK !== null) echo "selected" ?> ><?php echo $value?></option>
                                <?php }?>  
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">バリアフリー<span class='err'></span></td>
                        <td colspan="3">
                            
                            <table style="width: 100%;">
                                    <?php
                                        
                                        $DOCK_TBDO_CODE_LIST = $this->item_dock->DOCK_TBDO_CODE_LIST;
                                        if(isset($DOCK_TBDO_CODE_LIST)){ $list_disabled_dock = explode(",",$DOCK_TBDO_CODE_LIST); }
                                        foreach($this->listDisabledDock as $k => $value){
                                            if($k%3 == 0){
                                                echo "<tr>";
                                            }
                                            if(empty($list_disabled_dock))
                                                $checked = "";
                                            else
                                                $checked = array_search($value->TBDO_CODE, $list_disabled_dock) !== false ? "checked" : "";
                                            echo "<td><input type='checkbox' style='float:right;' name='cbdock$value->TBDO_CODE' id='cbdock$value->TBDO_CODE' value='$value->TBDO_CODE' $checked/></td>";
                                            echo "<td><label for='cbdock$value->TBDO_CODE'>$value->TBDO_NAME</label></td>";                                            
                                            
                                            if($k%3 == 2){
                                                echo "</tr>";
                                            }
                                        }
                                     ?>  
                                
                                </table> 
                        </td>
                    </tr>
               </table>
            </fieldset>    
        </td>
    </tr>
    <tr>
        <td colspan="5">
            <fieldset id="adminformfieldset">
                <legend>水面</legend>
               <table id="table_fee_list" >
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;width:12%">水面区分<span class='err'></span></td>
                        <td colspan="3" >
                            <select id="jform-dock-watm-code" name="jform[DOCK_WATM_CODE]" class="medium">
                              <option value="">選択してください</option>
                                <?php foreach($this->listWaterClass as $value){ ?>
    	                           <option value="<?php echo $value->WATM_CODE ?>" <?php if($value->WATM_CODE == $this->item_dock->DOCK_WATM_CODE){ echo 'selected="selected"'; } ?> ><?php echo $value->WATM_NAME?></option>
                                <?php }?>  
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;" >利用水面名</td>
                        <td colspan="6"> <input type="text" id="jform-dock-wname" name="jform[DOCK_WNAME]" class="input xbig" value="<?php echo $this->item_dock->DOCK_WNAME; ?>" /></td>
                    </tr>
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">広域水面名</td>
                        <td colspan="6"> <input type="text" id="jform-dock-wnamew" name="jform[DOCK_WNAMEW]" class="input xbig" value="<?php echo $this->item_dock->DOCK_WNAMEW; ?>" /></td>
                    </tr>
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">水面利用備考</td>
                        <td colspan="6"> <input type="text" id="jform-dock-wnote" name="jform[DOCK_WNOTE]"  class="input xbig" value="<?php echo $this->item_dock->DOCK_WNOTE; ?>" /></td>
                    </tr>
                    <!--<tr>
                        <td>水際状況</td>
                        <td colspan="6"> <input type="text" value="<?php// echo $this->item_dock->DOCK_SITUATION_BORDER; ?>" name="jform[DOCK_SITUATION_BORDER]" style="width:80%;" /></td>
                    </tr>-->
                    <tr>
                            <td style="text-align: right;font-size: 1.091em;padding-right:5px;">水際状況<span class='err'></span></td>
                            <td colspan="3">
                            <!--  <input type="text" value="<?php echo $this->data['DOCK_SITUATION_BORDER']; ?>" name="jform[DOCK_SITUATION_BORDER]"  style="width:80%;" /> -->
                            
                             <select name="jform[DOCK_DOWM_CODE]" class="inputbox">   
                              <option value="">選択してください</option>
                                <?php foreach($this->getModel()->getDOWM() as $dowm){ ?>
    	                           <option value="<?php echo $dowm->DOWM_CODE; ?>"<?php if($dowm->DOWM_CODE == $this->item_dock->DOCK_DOWM_CODE) echo "selected" ?> ><?php echo $dowm->DOWM_NAME ;?></option>
                                <?php }?>  
                            </select>
                               
                            </select>
                            </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td colspan="4"style="color: blue;font-size: 1.091em;">(推奨される画像の縦横比は「3:4」です。)</td>
                
                    </tr>
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">艇庫</td>
                        <td style="width: 7%;">
                            <input type="file" id="jformDOCK_IMGD" name="jformDOCK_IMGD" class="medium" />
                            <input type="hidden" name="jform[DOCK_IMGD_NEW]" id="value_DOCK_IMGD" value="" />
                            <input type="hidden" name="jform[DOCK_IMGD_OLD]" value="<?php echo $this->item_dock->DOCK_IMGD; ?>" />
                        </td>
                        
                        <td  style="text-align: right;font-size: 1.091em;padding-right:5px;">水際</td>
                        <td>
                            <input type="file" id="jformDOCK_IMGW" name="jformDOCK_IMGW" class="medium" />
                            <input type="hidden" name="jform[DOCK_IMGW_NEW]" id="value_DOCK_IMGW" value="" />
                            <input type="hidden" name="jform[DOCK_IMGW_OLD]" value="<?php echo $this->item_dock->DOCK_IMGW; ?>" />
                        </td>
                        
                    </tr>
                    <tr>
                        <td></td>
                        <td id="preview_IMGD" ><img style="width: 100px; height: 100px;" id="showimg_IMGD" src="uploads/images/com_pgb/<?php echo $this->item_dock->DOCK_IMGD ?>" /></td>
                        
                        <td></td>
                        <td id="preview_IMGW" ><img style="width: 100px; height: 100px;" id="showimg_IMGW" src="uploads/images/com_pgb/<?php echo $this->item_dock->DOCK_IMGW ?>" /></td>
                        
                    </tr>
                    <tr>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">水面</td>
                        <td style="width: 7%;"> 
                            <input type="file" id="jformDOCK_IMGS" name="jformDOCK_IMGS" class="medium" />
                            <input type="hidden" name="jform[DOCK_IMGS_NEW]" id="value_DOCK_IMGS" value="" />
                            <input type="hidden" name="jform[DOCK_IMGS_OLD]" value="<?php echo $this->item_dock->DOCK_IMGS; ?>" /> 
                        </td>
                        
                    </tr>
                    <tr>
                        <td></td>
                        <td id="preview_IMGS"><img style="width: 100px; height: 100px;" id="showimg_IMGS" src="uploads/images/com_pgb/<?php echo $this->item_dock->DOCK_IMGS; ?>" /></td>
                        
                    </tr>
               </table>
            </fieldset>      
        </td>
    </tr> 
    <tr>
        <td colspan="5">
            <fieldset id="adminformfieldset">
                <legend>料金</legend>
               <table id="table_fee_list" style="width: 100%" border=0>
                    <tr style="visibility:hidden">
                      <td style="width: 150px"></td>
                      <td style="width: 220px"></td>
                      <td style="width: 160px"></td>
                      <td style="width: 220px"></td>
                      <td style="width: 460px"></td>
                    </tr>
                    <tr style="vertical-align:top">
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px" >町内大人</td>
                        <td>
                            <input type="text" vvName="money" id="jform-dock-ciad" name="jform[DOCK_CIAD]" class="inputbox medium" value="<?php echo $this->item_dock->DOCK_CIAD; ?>" />
                            <span name="msg_error"></span>
                        </td>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">町内子供</td>
                        <td>
                            <input type="text" vvName="money" id="jform-dock-cici" name="jform[DOCK_CICI]" class="inputbox medium" value="<?php echo $this->item_dock->DOCK_CICI; ?>" />
                            <span name="msg_error"></span>
                        </td>
                    </tr>
                    <tr style="vertical-align:top">
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">町外大人</td>
                        <td>
                            <input type="text" vvName="money" id="jform-dock-coad" name="jform[DOCK_COAD]" class="inputbox medium" value="<?php echo $this->item_dock->DOCK_COAD; ?>" />
                            <span name="msg_error"></span>
                        </td>
                        <td style="text-align: right;font-size: 1.091em;padding-right:5px;line-height:30px">町外子供</td>
                        <td>
                            <input type="text" vvName="money" id="jform-dock-coci" name="jform[DOCK_COCI]" class="inputbox medium" value="<?php echo $this->item_dock->DOCK_COCI; ?>" />
                            <span name="msg_error"></span>
                        </td>
                    </tr>
                    <td style="text-align: right;font-size: 1.091em;padding-right:5px;">備考</td>
                    <td colspan="3"><input type="text" id="jform-dock-cnot" name="jform[DOCK_CNOT]" class="input xbig" value="<?php echo $this->item_dock->DOCK_CNOT; ?>" /></td>
               </table>
            </fieldset>
        </td>
    </tr>
    <tr>
        <td style="text-align: right;font-size: 1.091em;padding-right:5px;">備考</td>
        <td colspan="4"><textarea id="jform-dock-note" name="jform[DOCK_NOTE]" style="width: 57.5%;"><?php echo $this->item_dock->DOCK_NOTE; ?></textarea> </td>
    </tr>      
  </table>
</div>

  
   <?php echo JHtml::_('tabs.end');?>
   	<div>
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="action" value="edit" />
    </div>
</form>
   
<?php $timestamp = time();?>
<script>

    
  
        $(function() {
            var dockcode = document.getElementById("jformDOCK_CODE").value;
            $('#jformDOCK_IMGD').uploadify({
                'formData'     : {
        			'timestamp' : '<?php echo $timestamp; ?>',
        			'token'     : '<?php echo md5('unique_salt' . $timestamp); ?>',
                    'DOCK_CODE' : dockcode,
                    'STT'       : '1'
        		},
                'multi'    : false,
                'removeTimeout' : 1,
                'fileSizeLimit' : '125MB',
                'buttonText' : '画像を選択してください。',
                'width'    : 170,
                'swf'      : 'components/com_pgb/public/uploadlib/uploadify.swf',
                'uploader' : 'components/com_pgb/public/uploadlib/uploadify.php',           
                'onUploadSuccess' : function(file, data, response) {
                    
                    /* show image */
                    $('#preview_IMGD').html(
                    '<img style="width: 100px; height: 100px;" id="showimg_IMGD" src="uploads/images/com_pgb/'+data+'" />');
                    $('#value_DOCK_IMGD').val(data);
                }
                // Put your options here
            });
        });
        
        $(function() {
            var dockcode = document.getElementById("jformDOCK_CODE").value;
            $('#jformDOCK_IMGW').uploadify({
                'formData'     : {
        			'timestamp' : '<?php echo $timestamp; ?>',
        			'token'     : '<?php echo md5('unique_salt' . $timestamp); ?>',
                    'DOCK_CODE' : dockcode,
                    'STT'       : '2'
        		},
                'multi'    : false,
                'removeTimeout' : 1,
                'fileSizeLimit' : '125MB',
                'buttonText' : '画像を選択してください。',
                'width'    : 170,
                'swf'      : 'components/com_pgb/public/uploadlib/uploadify.swf',
                'uploader' : 'components/com_pgb/public/uploadlib/uploadify.php',           
                'onUploadSuccess' : function(file, data, response) {
                    
                    /* show image */
                    $('#preview_IMGW').html(
                    '<img style="width: 100px; height: 100px;" id="showimg_IMGW" src="uploads/images/com_pgb/'+data+'" />');
                    $('#value_DOCK_IMGW').val(data);
                }
                // Put your options here
            });
        });
    
        $(function() {
            var dockcode = document.getElementById("jformDOCK_CODE").value;
            $('#jformDOCK_IMGS').uploadify({
                'formData'     : {
        			'timestamp' : '<?php echo $timestamp; ?>',
        			'token'     : '<?php echo md5('unique_salt' . $timestamp); ?>',
                    'DOCK_CODE' : dockcode,
                    'STT'       : '3'
        		},
                'multi'    : false,
                'removeTimeout' : 1,
                'fileSizeLimit' : '125MB',
                'buttonText' : '画像を選択してください。',
                'width'    : 170,
                'swf'      : 'components/com_pgb/public/uploadlib/uploadify.swf',
                'uploader' : 'components/com_pgb/public/uploadlib/uploadify.php',           
                'onUploadSuccess' : function(file, data, response) {
                    
                    /* show image */
                    $('#preview_IMGS').html(
                    '<img style="width: 100px; height: 100px;" id="showimg_IMGS" src="uploads/images/com_pgb/'+data+'" />');
                    $('#value_DOCK_IMGS').val(data);
                }
                // Put your options here
            });
        });
        
        
        
        jq(document).ready(function() {
            /* add attribute for class="tabs" */
            jq( "#panel_1" ).parent().attr('id','tabs_1');
            jq( "#panel_2" ).parent().attr('id','tabs_2');
            jq( "#panel_3" ).parent().attr('id','tabs_3');
            
            /* jquery when change select box: gymt_2ndk */
            var gymt = jq('#jform-gymt_2ndk').val();
            if(gymt == 2){
                jq('#wrapper-gym2').css("display", "inline");
            }
            jq('#jform-gymt_2ndk').change(function(){
                var gymt = jq('#jform-gymt_2ndk').val();
                if(gymt == 2){
                    jq('#wrapper-gym2').css("display", "inline");
                }else{
                    jq('#wrapper-gym2').css("display", "none");
                }
            });
            
            
            
            //jq('#jformOCBA_CODE').autocomplete({source:'index.php?option=com_pgb&views=bg&task=searchOCBA_CODE', minLength:2});
            
            /* hide Pool - gymt - dock */
            
            var id = jq("#jformOCBA_CODE").val();
            if(id == ''){
                jq(".current_").hide();
                jq("#mess").show();
                jq(".panel_1_id").hide();
                jq(".panel_2_id").hide();
                jq(".panel_3_id").hide();
                
                jq("#tabs_1").css('display','none');
                jq("#tabs_2").css('display','none');
                jq("#tabs_3").css('display','none');
                
            }else{
                var cc = id.substr(0,1);
                if(cc == 1){
                    jq(".current_").show();
                    jq("#mess").hide();
                    jq(".panel_1_id").hide();
                    jq(".panel_2_id").hide();
                    jq(".panel_3_id").show();
                    
                    jq("#tabs_1").css('display','none');
                    jq("#tabs_2").css('display','none');
                    jq("#tabs_3").css('display','block');
                    
                    /* reset value tabs1 */
                    jq('#panel_1 input[type="text"]').each(function() {
                        jq(this).val('');
                    });
                    jq('#panel_1 input[type="checkbox"]').each(function() {
                        
                        jq(this).removeAttr('checked');
                    });
                    /* reset value tabs2 */
                    jq('#panel_2 input[type="text"]').each(function() {
                        jq(this).val('');
                    });
                    jq('#panel_2 input[type="checkbox"]').each(function() {
                        jq(this).removeAttr('checked');
                    });
                    
                }else{
                    jq(".current_").show();
                    jq("#mess").hide();
                    jq(".panel_1_id").show();
                    jq(".panel_2_id").show();
                    jq(".panel_3_id").show();
                    
                    if(jq(".panel_1_id").attr("class") == "tabs panel_1_id open"){
                        jq("#tabs_1").css('display','block');
                    }else{
                        jq("#tabs_1").css('display','none');
                    }
                    if(jq(".panel_2_id").attr("class") == "tabs panel_2_id open"){
                        jq("#tabs_2").css('display','block');
                    }else{
                        jq("#tabs_2").css('display','none');
                    }
                    if(jq(".panel_3_id").attr("class") == "tabs panel_3_id open"){
                        jq("#tabs_3").css('display','block');
                    }else{
                        jq("#tabs_3").css('display','none');
                    }
                }
            }        
             
        });
            
        /*show a dialog box: center search */
        jq('#link_ocba_code').bind('click', function(e){
            e.preventDefault();
            var id = jq("#ocba_code_old").val();
                zb = new jq.Zebra_Dialog('', {
                    source:  {'ajax': 'index.php?option=com_pgb&views=bg&task=popup_center&ocba_code_old='+id+'&tmpl=component'},
                    height: 800,
                    width: 550,
                    title:  'センター検索',
                    type:  '',
                    buttons:  [
                        {caption: '閉じる', callback: function() { }}
                            
                    ]
                });
            });
            
        /*select center id */
        jq(".link_ocba_code").live("click",function(){
            var id = jq(this).html();
            var cc = id.substr(0,1);
            if(cc == 1){
                jq(".current_").show();
                jq("#mess").hide();
                jq(".panel_1_id").hide();
                jq(".panel_2_id").hide();
                jq(".panel_3_id").show();
                
                jq("#tabs_1").css('display','none');
                jq("#tabs_2").css('display','none');
                jq("#tabs_3").css('display','block');
                
                /* reset value tabs1 */
                jq('#panel_1 input[type="text"]').each(function() {
                    jq(this).val('');
                });
                jq('#panel_1 input[type="checkbox"]').each(function() {
                    
                    jq(this).removeAttr('checked');
                });
                /* reset value tabs2 */
                jq('#panel_2 input[type="text"]').each(function() {
                    jq(this).val('');
                });
                jq('#panel_2 input[type="checkbox"]').each(function() {
                    jq(this).removeAttr('checked');
                });
                
            }else{
                jq(".current_").show();
                jq("#mess").hide();
                jq(".panel_1_id").show();
                jq(".panel_2_id").show();
                jq(".panel_3_id").show();
                
                if(jq(".panel_1_id").attr("class") == "tabs panel_1_id open"){
                    jq("#tabs_1").css('display','block');
                }else{
                    jq("#tabs_1").css('display','none');
                }
                if(jq(".panel_2_id").attr("class") == "tabs panel_2_id open"){
                    jq("#tabs_2").css('display','block');
                }else{
                    jq("#tabs_2").css('display','none');
                }
                if(jq(".panel_3_id").attr("class") == "tabs panel_3_id open"){
                    jq("#tabs_3").css('display','block');
                }else{
                    jq("#tabs_3").css('display','none');
                }
            }
            jq("#jformOCBA_CODE").val(id);
            centerName(id);
            checkCenter(id);
            zb.close();
            
        });  
        
        /* select center name */
        function centerName(ocba_code){
            jq.get('index.php?option=com_pgb&task=ajax_get_name&tmpl=component&ocba_code='+ocba_code,function(result){
                jq('#jformOCBA_NAME').val(result);
            });  
        }
        /* Check center exist */
        function checkCenter(ocba_code){
            if(ocba_code == ''){
                jq('#resultCheck').html('');
                jq(".current_").hide();
                //jq("#mess").show();
                jq(".panel_1_id").hide();
                jq(".panel_2_id").hide();
                jq(".panel_3_id").hide();
                
                jq("#tabs_1").css('display','none');
                jq("#tabs_2").css('display','none');
                jq("#tabs_3").css('display','none');
                
                return;
            }
            var ocba_code_old = jq("#ocba_code_old").val();
            var addnew = jq("#addnew").val();
            jq.get('index.php?option=com_pgb&task=checkCenter&tmpl=component&ocba_code='+ocba_code+'&ocba_code_old='+ocba_code_old+'&addnew='+addnew,function(result){
                jq('#resultCheck').html(result);
                //check result todo: show or hide center-club
                var check = jq('#check').val();
                if(check == 0){
                    jq(".current_").hide();
                    //jq("#mess").show();
                    jq(".panel_1_id").hide();
                    jq(".panel_2_id").hide();
                    jq(".panel_3_id").hide();
                    
                    jq("#tabs_1").css('display','none');
                    jq("#tabs_2").css('display','none');
                    jq("#tabs_3").css('display','none');
                }else{
                    var id = jq("#jformOCBA_CODE").val();
                    var cc = id.substr(0,1);
                    if(cc == 1){
                        jq(".current_").show();
                        jq("#mess").hide();
                        jq(".panel_1_id").hide();
                        jq(".panel_2_id").hide();
                        jq(".panel_3_id").show();
                        
                        jq("#tabs_1").css('display','none');
                        jq("#tabs_2").css('display','none');
                        jq("#tabs_3").css('display','block');
                        
                        /* reset value tabs1 */
                        jq('#panel_1 input[type="text"]').each(function() {
                            jq(this).val('');
                        });
                        jq('#panel_1 input[type="checkbox"]').each(function() {
                            
                            jq(this).removeAttr('checked');
                        });
                        /* reset value tabs2 */
                        jq('#panel_2 input[type="text"]').each(function() {
                            jq(this).val('');
                        });
                        jq('#panel_2 input[type="checkbox"]').each(function() {
                            jq(this).removeAttr('checked');
                        });
                        
                    }else{
                        jq(".current_").show();
                        jq("#mess").hide();
                        jq(".panel_1_id").show();
                        jq(".panel_2_id").show();
                        jq(".panel_3_id").show();
                        
                        if(jq(".panel_1_id").attr("class") == "tabs panel_1_id open"){
                            jq("#tabs_1").css('display','block');
                        }else{
                            jq("#tabs_1").css('display','none');
                        }
                        if(jq(".panel_2_id").attr("class") == "tabs panel_2_id open"){
                            jq("#tabs_2").css('display','block');
                        }else{
                            jq("#tabs_2").css('display','none');
                        }
                        if(jq(".panel_3_id").attr("class") == "tabs panel_3_id open"){
                            jq("#tabs_3").css('display','block');
                        }else{
                            jq("#tabs_3").css('display','none');
                        }
                        
                    }
                }
            });  
        }


    /* CALENDAR POOL */
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformPOOL_SDATE",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformPOOL_SDATE",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformPOOL_TDATE",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformPOOL_TDATE",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformPOOL_EDATE",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformPOOL_EDATE",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
    /* CALENDAR GYMT 1 */
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformGYMT_SDATE1",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformGYMT_SDATE1",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformGYMT_TDATE1",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformGYMT_TDATE1",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformGYMT_EDATE1",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformGYMT_EDATE1",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
    /* CALENDAR GYMT 2 */
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformGYMT_SDATE2",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformGYMT_SDATE2",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformGYMT_TDATE2",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformGYMT_TDATE2",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformGYMT_EDATE2",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformGYMT_EDATE2",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
    /* CALENDAR DOCK */
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformDOCK_SDATE",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformDOCK_SDATE",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformDOCK_TDATE",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformDOCK_TDATE",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
    window.addEvent('domready', function() {Calendar.setup({
        	// Id of the input field
        	inputField: "jformDOCK_EDATE",
        	// Format of the input field
        	ifFormat: "%Y/%m/%d",
        	// Trigger for the calendar (button ID)
        	button: "jformDOCK_EDATE",
        	// Alignment (defaults to "Bl")
        	align: "Bl",
        	singleClick: true,
        	firstDay: 0
    	});
    });
    
</script>